let statement = this.APP.DB.createStatement("DELETE FROM sync_queue WHERE type = :type AND url = :url");
statement.params.type = type;
statement.params.url = url;
this.batch.push( statement );
this.changeReadyForServer = true;
if (!batch) {
this.flushBatch();
}
},
// Clear sync queue
clearSyncQueue : function(fromLastRowId)
{
if (!fromLastRowId) fromLastRowId = 1000000;
let statement = this.APP.DB.createStatement("DELETE FROM sync_queue WHERE rowid <= :rowId");
statement.params.rowId = fromLastRowId;
this.batch.push( statement );
this.flushBatch();
},
// -- Sync -- //
syncingEnabled : function()
{
return this.APP.getLogin();
},
cancelSync : function()
{
this.syncing = false;
this.sending = false;
this.getting = false;
this.waitingToGet = false;
this.waitingToHardSync = false;
this.syncWasCancelled = true;
this.APP.refreshListInAllOpenWindows('list');
},
sync : function(hard, manual) {
if (!this.syncingEnabled())
{
this.APP.commandInTopRIL('switchToList', 'list');
this.APP.genericMessage("You need an account to sync your list with other computers and devices.", [{label:'Register',delegate:this.APP.getTopRIL(),selector:'openLogin'},
this.APP.genericMessage("Because Read It Later failed to load correctly, syncing has been disabled to prevent any loss of data.\n\nTry restarting Firefox or clicking 'Get Help'.",